package com.macro.mall.portal.controller;


import com.macro.mall.common.api.CommonResult;
import com.macro.mall.portal.domain.BankConfig;
import com.macro.mall.portal.domain.vo.PageVo;
import com.macro.mall.portal.service.IBankConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 银行信息配置表 前端控制器
 * </p>
 *
 * @author db
 * @since 2021-09-12
 */
@RestController
@RequestMapping("/bank")
@Api(tags = "银行信息", description = "银行信息")
public class BankConfigController {

    @Autowired
    private IBankConfigService bankConfigService;

    @ApiOperation("获取银行信息")
    @RequestMapping(value = "/getAll", method = RequestMethod.POST)
    public CommonResult getAll() {
        try {
            BankConfig config = bankConfigService.getById(1);
            return CommonResult.success(config);
        } catch (Exception e) {
            e.printStackTrace();
            return CommonResult.failed("服务器异常");
        }

    }
}
